package sg.com.techstudio.nic.controller;

import org.springframework.ui.Model;

public abstract class BaseController {
	public static final String SPRING_EXT 			= ".rw";
	public static final String PARAM_ERRMSG 		= "errmsg";
	public static final String PARAM_CONTENT_LIST	= "contentList";
	public static final String PARAM_CONTENT_LIST_2	= "contentList2";
	
	protected abstract String getModuleFolder();
	
	protected String redirectToPageSpring(String strURL) {
		return "redirect:/" + strURL;
	}

	protected String goToPageJsp(String strURL) {
		return getModuleFolder() + strURL;
	}
	
	protected void addError(Model model, String errMsg) {
		model.addAttribute(PARAM_ERRMSG, errMsg);
	}
}
